package com.sumainfor.pc.cfo.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.cfo.service.InvoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Meng
 * @ClassName InvoiceController
 * @date 2019/4/28 16:12
 * @description: TODO 财务部发票信息的控制层
 */
@RestController
@RequestMapping("/tenant/key/invoice")
//@RequestMapping("/invoice")
public class InvoiceControllers {

    @Autowired
    public InvoiceService invoiceService;


    /**
     * @Description //TODO 新增发票信息
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/4/29 19:37
     **/
    @PostMapping("/insertInvoice")
    public JsonResult insertInvoice(@RequestBody Map<String, Object> params) {

        JsonResult result = new JsonResult();
        if(invoiceService.insertInvoiceInfo(params)){
            result.putSuccess("发票申请成功！");
        }else{
            result.putFailed("服务器繁忙，请稍后重试！");
        }
        return result;
    }
}
